<?php

namespace app\common\model;

use think\Model;

class Document extends Model
{
    // 表名
    protected $name = 'document';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = true;

    public function setStartTimeAttr($value)
    {
        return strtotime($value);
    }

    public function setEndTimeAttr($value)
    {
        return strtotime($value);
    }

    public function company(){
        return $this->belongsTo('Company','companyid','id');
    }
}
